//index.js
//获取应用实例
const app = getApp()
const api = require('../../utils/api.js');
Page({
	data: {
		imgStr:"",
	},

	onLoad: function() {
		let _this = this;
		wx.getStorage({
		 	key: 'customerInfo',
		  	success: function(res) {
		  		_this.customerQrCode(res.data.id);
		  	} 
		})
	},
	
	customerQrCode:function(customerId){
		let _this = this;
		api.customerQrCode({
			data: {
				customerId:customerId
			},
			success: function(res) {
				if(res.data.code == 0) {
					let imgStr = res.data.obj.imgStr;
					
					_this.setData({
						imgStr: imgStr,
					})
				}
			},
		});
	},
})